﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/mobile_H.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Login
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <style type="text/css">
        input.ui-input-text
        {
            height: 31px;
            background-color: #FFF;
            border: 1px solid #bbbbbb;
            -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset;
            -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset;
            box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset;
        }
    </style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="FeaturedContent" runat="server">
    <div style="text-align: center;">
        <div style="background-color: #8094AE; height: 40px; margin-top: 0px;">
            <div style="color: White; padding-top: 10px;">
                Ply Cart Inventory</div>
        </div>
        <div style="margin: 10px;">
            <div style='float: left; width: 100px;'>
                <h4>
                    User Code :</h4>
            </div>
            <div>
                <input type="text" class="ui-input-text" id="txtcode" style="width: 140px" maxlength="6"
                    onkeypress="return numberOnly(event);" /></div>
            <div style="height: 5px;">
            </div>
            <div style='float: left; width: 100px;'>
                <h4>
                    Password :</h4>
            </div>
            <div>
                <input type="password" class="ui-input-text" id="txtpwd" style="width: 140px" /></div>
            <br />
            <input type="button" id="submit" value="Login" style="width: 100%" />
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ScriptsSection" runat="server">
    <% if (false)
       { %>
    <script src="../../Scripts/jquery-1.7.1.js" type="text/javascript"></script>
    <% } %>
    <script type="text/jscript">

        $(function () {
            $("#txtcode").focus();
            function submit() {
                if ($("#txtcode").val() == "") {
                    return;
                }
                if ($("#txtpwd").val() == "") {
                    return;
                }
                $.post('<%: Url.Action("EncodePass") %>' + '?pw=' + $("#txtpwd").val(), function (data) {
                    window.location = '<%=  Url.Action("LogOn_mobile","Account")  %>' + '?username=' + $("#txtcode").val() + '&password=' + data;
                });
            }
            $("#txtcode ,#txtpwd").on("keydown", function (event) {

                if (event.keyCode != 13) {
                    return;
                }
                if ($(this).attr("id") != "txtpwd") {
                    $(this).next('input').focus();
                } else {
                    
                    submit();
                }
            });

            $("#submit").click(function () {
                submit();
            });

        });
    </script>
</asp:Content>
